package com.kancy.vip.pattern.proxy.dynamicproxy;

import com.kancy.vip.pattern.proxy.Girl;
import com.kancy.vip.pattern.proxy.Love;
import com.kancy.vip.pattern.proxy.Person;
import com.kancy.vip.pattern.proxy.staticproxy.Boy;
import net.sf.cglib.proxy.*;

import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

/**
 * @author kancy
 * @date 2019/3/16 14:50
 */
public class JDKDynamicProxy {

	public static void main(String[] args) {

		Girl target = new Girl("pmm",23, 170);
		Meipo meipo = new Meipo(target);

		Love instance = (Love) Proxy.newProxyInstance(target.getClass().getClassLoader(),
				new Class[]{Girl.class}
				, meipo);
		Boy boy = new Boy("kancy", 24, 170);

		instance.toString();

		instance.findLove(boy);
	}


}
